import { reqSearchList, } from "@/api"
export default {
    namespaced: true,
    actions: {
        getSearchList({commit}, searchParams) {
            reqSearchList(searchParams).then((resp)=> {
                if (resp.code == 200) commit('GETSEARCHLIST', resp.data);
            }, (err) => {
                return Promise.reject(err);
            })
        }
    },
    mutations: {
        GETSEARCHLIST(state, data) {
            state.searchList = data;
           // console.log(data);
        }
    },
    state: {
        searchList: {
            goodsList:[],
            trademarkList:[],
            attrsList: [],
            pageNo: 1,
        }
    },
    getters: {
        searchGoodsList(state) {
            return state.searchList.goodsList;
        },
        trademarkList(state) {
            return state.searchList.trademarkList;
        },
        attrsList(state) {
            return state.searchList.attrsList;
        }
    }
}